{% extends "pretixcontrol/event/settings_base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load static %}
{% block title %}{% translate "Mails" %}{% endblock %}
{% block content %}
    <nav id="event-nav" class="header-nav">
        <div class="navigation">
            <div class="navigation-title">
                <h1>{% translate "Templates" %}</h1>
            </div>
            {% include "pretixcontrol/event/component_link.html" %}
        </div>
    </nav>
    {% block inside %}
        <form action="" method="post" class="form-horizontal" enctype="multipart/form-data"
                mail-preview-url="{% url 'control:event.settings.mail.preview' event=request.event.slug organizer=request.event.organizer.slug %}">
            {% csrf_token %}
            {% bootstrap_form_errors form %}
            <div class="form">
                <div class="panel-group" id="questions_group">
                    {% blocktrans asvar title_placed_order %}Placed order{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_placed" title=title_placed_order items="mail_text_order_placed,mail_send_order_placed_attendee,mail_text_order_placed_attendee" exclude="mail_send_order_placed_attendee" %}

                    {% blocktrans asvar title_paid_order %}Paid order{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_paid" title=title_paid_order items="mail_text_order_paid,mail_send_order_paid_attendee,mail_text_order_paid_attendee" exclude="mail_send_order_paid_attendee" %}

                    {% blocktrans asvar title_free_order %}Free order{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_free" title=title_free_order items="mail_text_order_free,mail_send_order_free_attendee,mail_text_order_free_attendee" exclude="mail_send_order_free_attendee" %}

                    {% blocktrans asvar title_resend_link %}Resend link{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="resend_link" title=title_resend_link items="mail_text_resend_link,mail_text_resend_all_links" %}

                    {% blocktrans asvar title_order_changed %}Order changed{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_changed" title=title_order_changed items="mail_text_order_changed" %}

                    {% blocktrans asvar title_payment_reminder %}Payment reminder{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_expires" title=title_payment_reminder items="mail_days_order_expire_warning,mail_text_order_expire_warning" exclude="mail_days_order_expire_warning" %}

                    {% blocktrans asvar title_waiting_list_notification %}Waiting list notification{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="waiting_list" title=title_waiting_list_notification items="mail_text_waiting_list" %}

                    {% blocktrans asvar title_order_canceled %}Order canceled{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_canceled" title=title_order_canceled items="mail_text_order_canceled" %}

                    {% blocktrans asvar title_order_custom_mail %}Order custom mail{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="custom_mail" title=title_order_custom_mail items="mail_text_order_custom_mail" %}

                    {% blocktrans asvar title_download_tickets_reminder %}Reminder to download tickets{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="ticket_reminder" title=title_download_tickets_reminder items="mail_days_download_reminder,mail_text_download_reminder,mail_send_download_reminder_attendee,mail_text_download_reminder_attendee,mail_sales_channel_download_reminder" exclude="mail_days_download_reminder,mail_send_download_reminder_attendee,mail_sales_channel_download_reminder" %}

                    {% blocktrans asvar title_require_approval %}Order approval process{% endblocktrans %}
                    {% include "pretixcontrol/event/mail_settings_fragment.html" with pid="order_approval" title=title_require_approval  items="mail_text_order_placed_require_approval,mail_text_order_approved,mail_text_order_approved_free,mail_text_order_denied" %}
                </div>
            </div>
            <div class="form-group submit-group">
                <button type="submit" class="btn btn-primary btn-save">
                    {% translate "Save" %}
                </button>
            </div>
        </form>
    {% endblock %}
{% endblock %}
